import React from 'react';
import ReactDOM from 'react-dom';
class App extends React.Component {
  state = {
    name: "朱云峰",
    sex: "男"
  }
  qq = {
    age: 100
  }
  changeName = () => {
    // console.log(this.state)
    // console.log(this.qq)
    // this.state.name = 888;
    // console.log(this.state)
    this.setState({
      name: 888
    })
  }
  render() {
    let { name, sex } = this.state;
    let { age } = this.qq
    return <div className=''>
      <h1>{name}-{sex}--{age}</h1>
      <button onClick={this.changeName}>改名字</button>
    </div>;
  }
}

ReactDOM.render(<App />, document.getElementById('root'))